function Bullet() {
	this.init = function() {
		this.body = create("div");
		this.body.className = "bullet";
		new GameEngine().append(this);
		this.body.style.left = new MyPlane().left() + new MyPlane().width() / 2 - this.width() / 2 + "px";
		this.body.style.top = new GameEngine().height() - new MyPlane().height() - this.height() + "px";
		this.move();
	}
	this.width = function() {
		return this.body.offsetWidth;
	}
	this.height = function() {
		return this.body.offsetHeight;
	}
	this.left=function(){
		return this.body.offsetLeft;
	}
	this.top=function(){
		return this.body.offsetTop;
	}
	this.move = function() { //移动
		this.timer = setInterval(function() {
			this.body.style.top = this.body.offsetTop - 5 + "px";
			if(this.body.offsetTop < -this.height()) {
				this.disappear();
			}
			for(var en of new GameEngine().enemes){
				var leftside=(this.left()+this.width())>en.left();
				var rightside=this.left()<(en.width()+en.left());
				var topside=(this.top()+this.height())>en.top();
				var bottomside=this.top()<(en.top()+en.height());
				if(leftside&&rightside&&topside&&bottomside){
					en.hurt();
					this.explode();
					clearInterval(this.timer);
					break;
				}
			}
		}.bind(this), 30)
	}
	this.explode = function() { //爆炸
		this.body.className="bullet_die";
		setTimeout(function(){
			this.body.background="url(images/die2.png)";
			setTimeout(function(){
				this.disappear();
			}.bind(this),100)
		}.bind(this),100)
	}
	this.disappear = function() {
		this.body.remove();
	}
}